package akka;

import akka.actor.ActorRef;
import akka.actor.Actor;

/**
 * Created by $liuwei on 2017/5/9.
 */
public class HelloClient implements Runnable {

    int seq;
    String serviceName;

    HelloClient(int seq, String serviceName) {
        this.seq = seq;
        this.serviceName = serviceName;
    }

    public void run() {
//        Actors.remo
//        Actor().
//        ActorRef actor = getContext().actorFor(serviceName, "10.68.15.113", 9999);
        String str = "Hello--" + seq;
        System.out.println("请求-----${str}");
//        Object res = actor.sendRequestReply(str);
        System.out.println("返回-----${res}");
    }


    public static void main(String[] args) {
        for (int i = 0; i < 5; i++) {
            Thread thread = new Thread(new HelloClient(i, "hello-service"));
            thread.start();       //同时启动5个客户端请求Master
        }
    }
}
